Received: from cs.uml.edu (cs.uml.edu [129.63.1.11]) by kantti.helsinki.fi (8.6.9/8.6.5) with SMTP id KAA27115 for <blitz-list@helsinki.fi>; Tue, 26 Jul 1994 10:39:09 +0300
Received: by cs.uml.edu id AA13092
(5.67a+/IDA-1.5 for blitz-list@helsinki.fi); Tue, 26 Jul 1994 03:39:04 -0400
From: Ralph Barbagallo <rbarbaga@cs.uml.edu>
Message-Id: <199407260739.AA13092@cs.uml.edu>
Subject: here it is.
To: blitz-list@helsinki.fi
Date: Tue, 26 Jul 1994 03:39:04 -0400 (EDT)
X-Mailer: ELM [version 2.4 PL22]
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Status:
Status: RO
Here's the problematic code.
;
; Space Invaders 2600 v.5b
; By Ralph A. Barbagallo III (c) 1994
;
; This is a clone of the classic Atari 2600 cartridge, Space Invaders
; Just a simple game to hone my skills.
;
NoCli ;Disable CLI window for easier debugging and a cleaner WB screen.
;
;Initialize variables
;
NEWTYPE.ship ;Data for player's ship.
x.q ;Player ship's x position.
y ;Player ship's y position.
End NEWTYPE
NEWTYPE.shield ;Data for 3 laser shields.
x.q ;Shield x position.
y ;Shield y position.
End NEWTYPE
NEWTYPE.invader ;Data for each 6x6 matrix alien.
x.q ;Alien x position.
y ;Alien y position.
death.b ;Death flag.
frontman ;Front row indicator.
End NEWTYPE
Dim List ships.ship(0) ;Dimension a list of ship types.
Dim List shields.shield(3) ;Dimension a list of shield types.
Dim invaders.invader(6,6) ;Dimension a 6x6 matrix of aliens.
LoadShape 0,"playership.shape",0 ;Load in shapes from brush file.
LoadShape 1,"bullet.shape",0
LoadShape 2,"mysteryship.shape",0
LoadShape 3,"invshield.shape",0
LoadShape 4,"row1.shape",0
LoadShape 5,"row2.shape",0
LoadShape 6,"row3.shape",0
LoadShape 7,"row4.shape",0
LoadShape 8,"row5.shape",0
LoadShape 9,"row6.shape",0
BitMap 0,320,200,3 ;Initialize an 8 color, lo-res bitmap for background.
BitMap 1,320,200,3 ;Initialize 8 color, lo-res bitmap for double buffer.
LoadBitMap 0,"invadersbkg.iff",0 ;Load .iff to bitmap for background.
LoadBitMap 1,"invadersbkg.iff",0 ;Load 2nd .iff for double buffering.
While AddLast(ships()) ;Initialize ship's position variable.
ships()\x=140,164
Wend ;When the last item in the array has been filled, exit loop.
While AddLast(shields()) ;Cycle through list of sheilds, initialize vars.
shields()\x=A.q,140 ;Initialize incremented x value, default y value.
A.q = A.q+70 ;Increment X value to space shields off.
Wend
Xstart.q = 25
For A = 1 To 6
Ystart.q = 20
For B = 1 To 6
invaders (A,B)\x=Xstart,Ystart,0,0
Ystart.q = Ystart.q+18
Next
Xstart.q = Xstart.q+40
Next
BLITZ ;Jump into BLITZ mode now that disk access is through.
Buffer 0,16384 ;2 Buffers for double buffering action.
Buffer 1,16384
Slice 0,44,320,200,$fff0,3,8,32,320,320 ;Initialize slice for bitmap.
Use Palette 0 ;Use palette 0, gained from .iff file.
Show 0 ;Show slice 0, background graphics.
;
;Manipulate graphics, respond to joystick commands.
;
While Joyb(0)=0 ;While mousebutton hasn't been pressed.
ResetList ships() ;Start at top of shape list.
VWait ;Wait for vertical blank.
Show db:db=1-db:Use BitMap db ;Toggle bitmaps for double buffering
UnBuffer db ;Unqueue items in used bitmap.
While NextItem(ships()) ;while the entire list hasn't been cycled...
If Joyx(1)= 1 Then ships()\x = ships()\x+1 ;adjust x value according
If Joyx(1)= -1 Then ships()\x = ships()\x-1 ;to joystick movement.
If ships()\x<50 Then ships()\x=50 ;stop movement at left and
If ships()\x>225 Then ships()\x=225 ;right borders.
BBlit db,0,ships()\x,ships()\y ;draw ship at proper position.
Wend
;
; Blit shields onto screen.
;
For a = 1 To 3 ;Cycle through list of shields.
BBlit db,3,shields(a)\x,shields(a)\y ;Blit shields on screen.
Next
;
; Blit 6x6 matrix of aliens on screen.
;
boundflag = 0
For A=1 To 6
If boundflag<>0 Then Pop For
For B=1 To 6
If invaders (A,B)\x >310 Then boundflag = 1
If invaders (A,B)\x <10 Then boundflag = 2
If boundflag <> 0 Then Pop For
Next
Next
Statement LEFT{}
For A= 1 To 6
For B=1 To 6
invaders (A,B)\x = invaders (A,B)\x -2
Next
Next
End Statement
Statement RIGHT{}
For A= 1 To 6
For B= 1 To 6
invaders (A,B)\x = invaders (A,B)\x +2
Next
Next
End Statement
If boundflag = 0 Then LEFT{}
If boundflag = 1 Then LEFT{}
If boundflag = 2 Then RIGHT{}
For A=1 To 6 ;Cycle through the 6x6 matrix with nested loops.
Invader = 4 ;Initial object number (invader graphic 1).